home *** CD-ROM | disk | FTP | other *** search
/ PC Media 20 / PC MEDIA CD20.iso / share / prog / pentium / pentium.err < prev    next >
Encoding:
Text File  |  1994-12-20  |  13.0 KB  |  299 lines

  1.                 Pentium Study
  2.  
  3.  http://www.ibm.com
  4.  IBM study: likelihood of Pentium chip error 
  5.  
  6.  
  7.  
  8.  
  9.       IBM Research focused on the likelihood of error on the
  10.       Pentium chip in everyday floating point division activities.
  11.       Intel has analyzed the probability of making an error based
  12.       on the assumption that any possible 64 bit pattern is
  13.       equally likely to occur in both the numerator and the
  14.       denominator.  If that were the case, then the chances of the
  15.       error would be 1 in 9 billion.  They also estimate that an
  16.       average spreadsheet user will perform 1,000 floating point
  17.       division per day.  Based on these assumptions, Intel
  18.       estimates that an error will be encountered only once in 9
  19.       million days (or once in about 27,000 years).
  20.   
  21.       Our analysis shows that the chances of an error occurring
  22.       are significantly greater when we perform simulations of the
  23.       types of calculations performed by financial spreadsheet
  24.       users, because, in this case, all bit patterns are not
  25.       equally probable.
  26.   
  27.      Probability Tests:
  28.    
  29.       We have analyzed a Pentium chip in order to understand the
  30.       sources of errors and have found that in order for an error
  31.       to occur, both the numerator and denominator must have
  32.       certain "bad" bit patterns, as described below.
  33.   
  34.       First, for the denominator to be "at risk", that is, capable
  35.       of producing an error with certain numerators, it must
  36.       contain a long string of consecutive 1's in its binary
  37.       representation.  Although such numbers represent only a very
  38.       small fraction of all possible numbers, they do occur much
  39.       more frequently when denominators are created by adding,
  40.       subtracting, multiplying or dividing simple numbers.  For
  41.       example, the number 3.0 represented exactly, does not have
  42.       that pattern, but the result of the computation 4.1-1.1 does
  43.       have that pattern.
  44.   
  45.       How many denominators produced in this fashion can be "at
  46.       risk" that is, capable of producing an error for certain
  47.       numerators?  When we randomly added or subtracted ten random
  48.       numbers having a single digit dollar amount and two digit in
  49.       cents, for example, $4.57, then one out of every 300 of the
  50.       results was "at risk" and hence capable of producing an
  51.       error.  If we repeated the test with numbers having two
  52.       digit dollar amounts and two digits in cents, then one out
  53.       of every 2,000 could cause an error.  If the denominator was
  54.       calculated by dividing two numbers having one digit to the
  55.       left and one to the right of the decimal point, then
  56.       approximately one in every 200 could cause an error.
  57.   
  58.       For simplicity, suppose that one of every 1000 denominators
  59.       produced by some calculations was "at risk."
  60.   
  61.       Now, suppose we have created a bad denominator.  What is the
  62.       chance of now encountering a bad numerator, which will
  63.       produce an error?  It depends on the actual value of the
  64.       "at risk" denominator, but based on our tests, a
  65.       conservative estimate would be that only one out of every
  66.       100,000 numerators causes a problem.
  67.   
  68.       Finally, when we combine the chances of a bad numerator and
  69.       the chances of a bad denominator, the result is that one out
  70.       of every 100 million divisions will give a bad result.  Our
  71.       conclusion is vastly different from Intel's.
  72.   
  73.      Frequency Tests:
  74.   
  75.       We also questioned Intel's analysis and assumption that
  76.       spreadsheet users will only perform 1,000 divides in a day.
  77.       Tests run independently suggest that a spreadsheet user
  78.       (Lotus 1-2-3) does about 5,000 divides every second when he
  79.       is calculating his spreadsheet.  Even if he does this for
  80.       only 15 minutes a day, he will perform 4.2 million divides
  81.       in a day, and according to our probability findings, on
  82.       average, a computer could make a mistake every 24 days.
  83.       Hypothetically, if 100,000 Pentium customers were doing 15
  84.       minutes of calculations every day, we could expect 4,000
  85.       mistakes to occur each day.
  86.   
  87.      Conclusion:
  88.   
  89.       The Pentium processor does make errors on floating point
  90.       divisions when both the numerator and denominator of the
  91.       division have certain characteristics.  Our study is an
  92.       analysis based on probabilities and chances.  In reality, a
  93.       user could face either significantly more errors or no
  94.       errors at all.  If an error occurs, it will first appear in
  95.       the fifth or higher significant digit and it may have no
  96.       effect or it may have catastrophic effects.
  97.  
  98.  
  99.   
  100.      Additional Technical Detail:
  101.  
  102.            Some Experiments on Pentium Using Decimal Numbers
  103.   
  104.  According to an Intel white paper, if you were to choose a random
  105.  binary bit pattern for numerator and the denominator, the probability
  106.  of error in divide is about 1 in 9 billion.
  107.   
  108.  The error occurs when certain divisors (termed "at risk" or bad)
  109.  are divided into certain numerators. In order for the error to
  110.  occur, our belief is that divisors must lie in a certain range.
  111.  For each such denominator, there is a range of numerator values
  112.  which produce an incorrect result.
  113.   
  114.  An example of affected numbers is the decimal constants
  115.  we hardwire in our programs. For example, if converting
  116.  from months to years and we are interested in 7-8 decimal digits
  117.  of accuracy, then we can hard wire a constant to convert from
  118.  months to years.
  119.   
  120.         alpha = 1/12 = .083333333
  121.   
  122.  Let us construct a hypothetical example. We have contracted
  123.  a job which is expected to last 22.5 months. The total
  124.  value of the contract is $96000. From this, tax at the
  125.  rate of 14 and 2/3 percent rate has to be deducted.
  126.  The taxing authority has defined 14 and 2/3 percent to
  127.  be 14.66667. We want to calculate the net take at a per
  128.  annum basis. We do the following calculations.
  129.   
  130.       Tax = 96000*.1466667 =  14080.0032
  131.  
  132.  Net take home money = 96000 - 14080.0032 = 81919.9968
  133.  
  134.  The number of years in 22.5 months = 22.5*.083333333
  135.                                     = 1.8749999925 years
  136.  
  137.  Net take home money per annum =  81919.9968/1.8749999925
  138.  
  139.                                =  $43690.6667
  140.   
  141.  Most machines give the above answer which satisfies the
  142.  desired 7-8 digit accuracy criterion. On Pentium,
  143.  the answer is $43690.53, which has only 5 correct digits.
  144.  
  145.  In this example, both numerator and denominator are bad numbers.
  146.  They are both near some simple integer boundary in their binary
  147.  presentation and as you rightly observed, these numbers occur
  148.  in real world at a much higher frequency compared to the
  149.  totally random bit pattern hypothesis.
  150.   
  151.      Probabilistic Analysis
  152.  
  153.  We are addressing the question of how likely it is to have a bad
  154.  divisor. On Pentium, a bad divisor belongs to one of the five
  155.  bad table entries characterized by  1.0001, 1.0100, 1.0111, 1.1010, and
  156.  1.1101, followed by a string of 1's in the mantissa.
  157.   
  158.  We have found that if the string of 1's is of length 20 or so, then it is
  159.  a bad divisor. Given a bad divisor, the probability of making an error
  160.  in the division increases dramatically, compared to the 1 in 9 billion
  161.  figure quoted by Intel.
  162.   
  163.  We did some simple experiments using decimal numbers and the findings
  164.  are reported below. We counted only those bad divisors
  165.  which belong to one of the above five table values, followed
  166.  by a string of 32 1's.  Intel people argue that all binary patterns
  167.  are equally likely. If that was really the case, the probability
  168.  of finding a bad divisor, as defined above, will be 5/(2**36)
  169.  or about one in 13 billion random divisors. However, we are finding
  170.  the probabilities to be much higher.
  171.   
  172.      Addition/Subtraction of Decimal Numbers
  173.  
  174.  In this experiment, we randomly added or subtracted, 10 uniformly distributed
  175.  random numbers having one or two decimal digits (as in dollars and cents)
  176.  and then we examined the result for the above binary patterns.
  177.  Here are the results for two cases. In the
  178.  first case, we chose only one digit to the left of decimal (as in $3.47)
  179.  and in the second case, we chose two digits to the left of the decimal
  180.  (as in $29.56). All the digits were chosen randomly with uniform probability.
  181.  In the third case, we chose one digit to the right of the decimal point
  182.  and two digits to the left.
  183.  The results below give the number of times the result of this
  184.  experiment has the bit pattern corresponding to a bad divisor.
  185.  
  186.       Case 1 (one digit to the left, two to the right)   ---   188 out of 100,000
  187.       Case 2 (two digits to the left, two to the right)  ---    45 out of 100,000
  188.       Case 3 (two digits to the left, one to the right)  ---   356 out of 100,000
  189.   
  190.  Clearly, these probabilities are much higher than those obtained
  191.  with the random bit pattern hypothesis.
  192.   
  193.      Division Of Two Decimal Numbers:
  194.  
  195.  These experiments were conducted through exhaustive tests on
  196.  all possible digits patterns. Here  (a.b)/(c.d) represents
  197.  division of a two digit (one to the left of the decimal point
  198.  and one to the right of the decimal point) number by another
  199.  two digit number.
  200.   
  201.      (a.b)/(c.d)       -     44 out of 10,000
  202.      (0.ab)/(0.cd)     -     27 out of 10,000
  203.      (a.bc)/(d.ef)     -    344 out of 1,000,000
  204.      (ab.c)/(de.f)     -    422 out of 1,000,000
  205.   
  206.      Multiplication of Two Numbers
  207.  
  208.  Here we are multiplying a decimal number by another number which
  209.  was computed as a reciprocal of another decimal number as in scaling
  210.  by a constant.
  211.   
  212.      (a.b)  * (1/(c.d))       -    37 out of 10,000
  213.      (a.bc) * (1/(d.e))       -   139 out of 100,000
  214.      (a.bc) * (1/(d.ef))      -   434 out of 1,000,000
  215.  
  216.  To summarize, for the decimal calculations of the type given above,
  217.  the probability of having a result which falls into the category of
  218.  being a bad divisor is rather high. It appears to be somewhere
  219.  between 1 in 3000 to 1 in 250. Let us say that it is of the order
  220.  of 1 in 1000.
  221.   
  222.  Furthermore, if the rounding mode corresponds to truncate, the
  223.  probability of arriving at bad divisors increases significantly.
  224.   
  225.  
  226.      The Dependency on Numerator
  227.  
  228.  Given a bad divisor, the divide error occurs for some range of values
  229.  of the numerator. If we were to take a totally random bit
  230.  pattern for the denominator, the probability of error
  231.  appears to be of the order one in 100,000. This is a first cut
  232.  rough estimate and probably could be improved. It appears that
  233.  probabilities are different for different table values. The
  234.  table corresponding to '1.0001' seems to have the most error.
  235.  For numerator also, there are
  236.  bands of values where the error is much more likely. Again
  237.  these bands are more prominent near whole numbers.
  238.  For example. if we were using (19.4 - 10.4) = '9' as a divisor
  239.  (a bad one), and you picked a random value between 6 and 6.01,
  240.  as the numerator then the chance of error increases to about
  241.  one in 1000.
  242.   
  243.  For the purpose of our simplistic analysis, we will use the
  244.  figure of 1 in 100,000 for a bad numerator. This assumes that
  245.  we are picking up a random numerator. Using the value of  1
  246.  in 1000 as the probability for a bad divisor, the overall
  247.  probability for a 'typical' divide being incorrect seems to
  248.  be of the order of 1 in 100 millions. This is about two orders of
  249.  magnitude higher compared to the Intel estimate of 1 in 9 billion.
  250.   
  251.  
  252.  
  253.     Probability of a Divide Instruction
  254.  
  255.  Let us assume that a Pentium operating at 90 MHz does an op
  256.  in 1.2 cycles on the average. That will give about 75 Million ops
  257.  per second of actual compute time. We will use
  258.  a figure of 1 divide per 16,000 instructions, even though many
  259.  estimates suggest a much higher frequency of divide.
  260.   
  261.  Thus using this conservative estimate of one divide per 16,000
  262.  instructions, we come up at about 4687 divides per second.
  263.  Let us further assume that a typical spread-sheet user
  264.  does only about 15 minutes of actual intensive computing
  265.  per day. Then, he is likely to do 4687*900 =  4.2 million
  266.  divides per day. Assuming an error rate of 1 in 100 million,
  267.  it will take about 24 days for an error to occur for an
  268.  individual user.
  269.   
  270.  Combine this with the fact that there are millions of
  271.  PENTIUM users worldwide, we quickly come to the conclusion
  272.  that on a typical day a large number of people are making
  273.  mistakes in their computation without realizing it.
  274.   
  275.  
  276.  IBM Corporation
  277.  ibmstudy@watson.ibm.com
  278.  
  279.  
  280.  <!-- end ibmbody--------------------------------------------------------- -->
  281.  
  282.  <p> <hr>
  283.  <b>
  284.  [
  285.  <a href="http://www.ibm.com/">IBM home page</a> |
  286.  <a href="http://www.ibm.com/Orders/">Order</a> |
  287.  <a href="http://www.austin.ibm.com/search/">Search</a> |
  288.  <a href="http://www.ibm.com/Assist/">Contact IBM</a> |
  289.  <a href="http://www.ibm.com/Finding/">Help</a> |
  290.  <a href="http://www.ibm.com/copyright.html"> Copyright</a>  |
  291.  <a href="http://www.ibm.com/trademarks.html">tm</a>
  292.  ]
  293.  </b>
  294.  
  295.  </body>
  296.  </html>
  297.  
  298.  
  299.